package com.wry.controller;

import com.wry.Dao.UserDao;
import com.wry.entity.User;
import com.wry.service.Order;
import com.wry.service.OrderService;
import com.wry.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Controller
@RequestMapping("/users")
public class userController {
    @Autowired
    private RedisTemplate redisTemplate;

    @Resource(name = "")
    private UserService userService;

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public String rest(@PathVariable Integer id) {

        return id + "";
    }

//
//    @GetMapping("/{id}")
//    public String getById(@PathVariable Integer id) {
//        System.out.println("id ==> " + id);
//        return "hello , spring boot!";
//    }

    @RequestMapping("/aop")
    public String aopTest() {
        userService.aopServe();
        return "aop";
    }

    @RequestMapping("/redis")
    @ResponseBody
    public String redisTest() {
        return "found id";
    }

}

